package com.gr.experimental.model.impl.distr.operations;

import com.gr.experimental.model.impl.distr.Context;

public abstract class AbstractFunction implements Function {
	
	String name;
	
	Class<?> returnType;
	
	Class<?>[] parameterTypes;

	private boolean contextDependent;

	public AbstractFunction(String name, 
			Class<?> returnType, 
			Class<?>[] parameterTypes,
			boolean contextDependent) {
		this.name = name;
		this.returnType = returnType;
		this.parameterTypes = parameterTypes;
		this.contextDependent = contextDependent;
	}

	public String getName() {
		return name;
	}

	public Class<?> getReturnType() {
		return returnType;
	}

	public Class<?>[] getParameterTypes() {
		return parameterTypes;
	}

	@Override
	public abstract Object invoke(Context ctx, Object[] parameters);

	public boolean isContextDependent() {
		return contextDependent;
	}
	
	
}
